import {time2str} from '@/libs/date'
import {CnMediumSpan, CnNormalSpan} from '../text'

export const CreateDate = defineComponent({
  props: {
    date: {
      type: String,
      required: true
    }
  },
  setup(props, ctx) {
    const dateCn = computed(() => time2str(props.date))
    return () => (
      <div class='flex flex-col justify-center'>
        <CnMediumSpan class='text-center'>{dateCn.value}</CnMediumSpan>
        <CnNormalSpan class='text-12 text-center'>{props.date}</CnNormalSpan>
      </div>
    )
  }
})
